import request from "../utils/request";

// 登录
export const getPostListAPI=(params)=>{
  return request({
    url:'/community/getPostList',
    method:'get',
    params:params
  })
}
export const PostIsGood=(userId,id)=>{
  return request({
    url:'/community/isGood',
    method:'put',
    params:{
      userId:userId,
      id:id
    }
  })
}
export const PostIsNotGood=(userId,id)=>{
  return request({
    url:'/community/isNotGood',
    method:'put',
    params:{
      userId:userId,
      id:id
    }
  })
}

export const addPostAPI=(params)=>{
  return request({
    url:'/community/addPost',
    method:'post',
    data:params
    
  })
}
export const getPostInfoAPI=(params)=>{
  return request({
    url:'/community/getPostInfo',
    method:'get',
    params:params
  })
}
export const addPostCommentAPI=(params)=>{
  return request({
    url:'/community/addPostComment',
    method:'post',
    data:params
  })
}
export const getPostCommentListAPI=(params)=>{
  return request({
    url:'/community/getPostCommentList',
    method:'get',
    params:params
  })
}
export const searchPostsAPI = (params) => {
  return request({
    url: '/community/searchPosts',
    method: 'GET',
    params
  })
}